<template>
  <div class="view-container">
    <el-form :model="ruleForm"  ref="ruleForm" label-width="100px" class="demo-ruleForm">

<!--      "ruleForm.departmentId"-->
      <el-form-item label="部 室：" prop="region">




            <el-select v-model="ruleForm.departmentId"  placeholder="请选择部门">
              <el-option
                v-for="item of XZKdata"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>


      </el-form-item>

      <el-form-item label="序号：" prop="name">
        <el-input v-model="ruleForm.xuHao"></el-input>
      </el-form-item>

      <el-form-item label="区域：" prop="name">
        <el-input v-model="ruleForm.quYu"></el-input>
      </el-form-item>

      <el-form-item label="序号：" prop="name">
        <el-input v-model="ruleForm.xuHao2"></el-input>
      </el-form-item>

      <el-form-item label="物品名称：" prop="name">
        <el-input v-model="ruleForm.wuPinMingCheng"></el-input>
      </el-form-item>

      <el-form-item label="数量：" prop="name">
        <el-input v-model="ruleForm.shuliang"></el-input>
      </el-form-item>

      <el-form-item label="颜色：" prop="name">
        <el-input v-model="ruleForm.yanSe"></el-input>
      </el-form-item>

      <el-form-item label="规格：" prop="name">
        <el-input v-model="ruleForm.guiGe"></el-input>
      </el-form-item>

      <el-form-item label="价格：" prop="jiaGe">
        <el-input v-model="ruleForm.jiaGe"></el-input>
      </el-form-item>

      <el-form-item label="时间" required>
        <el-col :span="11">
          <el-form-item prop="date1">
            <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.shiJian" style="width: 100%;"></el-date-picker>
          </el-form-item>
        </el-col>
      </el-form-item>



      <el-form-item label="备注：" prop="desc">
        <el-input type="textarea" v-model="ruleForm.beiZhu"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="zichanAdds">保存</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  import ziChan from "@/api/ziChan/ziChan";
  import danganXZK from "@/api/dangan/bumenselect/danganXZK";
  export default {
    name: "zichanadd",
    data() {
      return {
        ruleForm:{
          "beiZhu": "string",  //备注
          "departmentId": 0, //部门ID
          "guiGe": "string", //规格
          "jiaGe": 0,   //价格
          "quYu": "string",  //区域
          "shiJian": "2020-06-29T09:44:29.603Z",  //时间
          "shuliang": 0,  // 数量
          "wuPinMingCheng": "string", //物品名称
          "xuHao": "string", //序号
          "xuHao2": "string",//序号
          "yanSe": "string"//颜色
        },
        XZKdata: {}, //部门组
      }
    },
    created() {
      this.XZKlist()
    },
    methods: {
      zichanAdds(){
        ziChan.zichanAdd(this.ruleForm).then(res=>{
          this.$message.success("添加成功")
        })
      },
      //部门select
      XZKlist() {
        danganXZK.getBumen().then(res => {
          this.XZKdata = res.result;
          console.log(this.XZKdata);
        });
      }
    }
  }
</script>

<style scoped lang="scss">
    .view-container{
      .el-input{
        width: 600px;
      }
    }
</style>
